import React, { useEffect, useState, useMemo } from 'react'
import { Space, Button, Checkbox } from 'antd'
import { useSelector, useDispatch } from 'react-redux'
import { clearsed } from './store/todoSlice'
//底部组件
export default function Footer() {

  let obj = useSelector(state => state.todos11)
  let dispatch = useDispatch()

  return (
    <div>
      <Space>
        <Checkbox checked={1} onChange={() => {

        }}>全选</Checkbox>
        <span>选择个数:{10}</span>
        <span>共个数:{obj.todolist.length}</span>
        <Button onClick={() => {
          //清除已完成的方法
          dispatch(clearsed())
        }}>清除已完成</Button>
      </Space>
    </div>
  )
}
